<style scoped>
  .main {
    width: 100%;
    margin-top: 0.88rem;
  }
  .tab-box{
    display: flex;
    flex-direction: row;
    font-size: 15px;
    height: 0.88rem;
    line-height: 0.88rem;
    color: #585858;
    border-bottom:1px solid #EEEEEE ;
    background: white;
  }
  .tab-box div{
    flex: 1;
    text-align: center;
    position: relative;
  }
  .active{
    width: 0.5rem;
    height: 0.08rem;
    /*background-image: linear-gradient(90deg, #30ABFD 0%, #2095FA 100%);*/
    color: #363636;
    /*border-bottom: 1px solid #30ABFD;*/
    position: absolute;
    bottom: 0;
    left: 50%;
    display: block;
    margin-left: -0.25rem;
    background: #30ABFD;
    border-radius: 5px;
  }
  .xz{
    color: #363636;
    font-weight: bold;
  }

</style>
<template>
  <div class="main">
    <navx  :msg="msg"></navx>
    <div class="tab-box">
        <div v-for="(item,index) in tab" @click="tabx(index)">
          <div :class="item.idx==idx?'xz':''">{{item.title}}</div>
          <span class="active" v-if="item.idx==idx"></span>
        </div>
    </div>
    <div v-if="idx==1">
      <jinri></jinri>
    </div>
    <div v-if="idx==2">
      <history></history>
    </div>
    <div v-if="idx==3">
      <jiexi></jiexi>
    </div>



  </div>
</template>

<script>
  import navx from '@/components/navx'
  import jinri from '@/components/jinri'
  import jiexi from '@/components/jiexi'
  import history from '@/components/history'
  import axios from 'axios'
  export default {
    name: '',
    data () {
      return {
        msg:'',
        idx:1,
        tab:[{title:'今日试题',idx:'1'},{title:'历史试题',idx:'2'},{title:'精讲解析',idx:'3'}]
      }
    },components:{
    navx,jinri,jiexi,history
  }
    , created(){

    }, mounted(){
    }, methods: {
      tabx:function (index) {
        this.idx=index+1;
        // console.log(this.idx)
        if(this.idx==1){
          this.msg='专属试题'
        }
        if(this.idx==2){
          this.msg='历史试题'
        }
      }
    }
  }
</script>
